package cn.com.huzo.model.entities.trade;

import com.fasterxml.jackson.annotation.JsonFormat;
import huzofw.model.entities.BaseEntity;
import huzofw.model.entities.IAggregateRoot;
import java.io.Serializable;
import java.util.Date;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.springframework.format.annotation.DateTimeFormat;

/**
 * 合同评审表主记录实体类
 *
 * @author 吴旭
 */
public class ContractReviewHeaderEntity extends BaseEntity implements Serializable, IAggregateRoot {

    private static final long serialVersionUID = -4642494383037876477L;
    private Long HeaderId;
    private Long CustomerId;                      // 客户名称
    private String CustomerName;
    private String ContractNo;                    // 合同号（不重复）
    private Date ContractSignedDate;              // 合同签订日期
    private Long SaledBy;                         // 事业部代表
    private String SaledByName;
    private Long TradeModeId;                     // 贸易形式
    private String TradeModeName;
    private Long CurTypeId;                       // 结算币种
    private String CurTypeName;
    private Long ExchangeRateId;                  // 汇率
    private Double ExchangeRate;
    private String PriceTerms;                    // 价格条款
    private Long SettlementModeId;                // 结算方式
    private String SettlementModeName;
    private Date ExpectedClosingDate;             // 预计结单日期
    private Double TotalQuantity;                 // 总生产数
    private Double TotalCost;                     // 总费用
    private Short WhatRound;                      // 次别（第几次）
    private String Description;                   // 备注
    private String SignedFlag;                    // 已作合同标记
    private String CostForecastFlag;

    public Long getHeaderId() {
        return HeaderId;
    }

    public void setHeaderId(Long HeaderId) {
        this.HeaderId = HeaderId;
    }

    public Long getCustomerId() {
        return CustomerId;
    }

    public void setCustomerId(Long CustomerId) {
        this.CustomerId = CustomerId;
    }

    public String getCustomerName() {
        return CustomerName;
    }

    public void setCustomerName(String CustomerName) {
        this.CustomerName = CustomerName;
    }

    public String getContractNo() {
        return ContractNo;
    }

    public void setContractNo(String ContractNo) {
        this.ContractNo = ContractNo;
    }

     @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Date getContractSignedDate() {
        return ContractSignedDate;
    }

    public void setContractSignedDate(Date ContractSignedDate) {
        this.ContractSignedDate = ContractSignedDate;
    }

    public Long getSaledBy() {
        return SaledBy;
    }

    public void setSaledBy(Long SaledBy) {
        this.SaledBy = SaledBy;
    }

    public String getSaledByName() {
        return SaledByName;
    }

    public void setSaledByName(String SaledByName) {
        this.SaledByName = SaledByName;
    }

    public Long getTradeModeId() {
        return TradeModeId;
    }

    public void setTradeModeId(Long TradeModeId) {
        this.TradeModeId = TradeModeId;
    }

    public String getTradeModeName() {
        return TradeModeName;
    }

    public void setTradeModeName(String TradeModeName) {
        this.TradeModeName = TradeModeName;
    }

    public Long getCurTypeId() {
        return CurTypeId;
    }

    public void setCurTypeId(Long CurTypeId) {
        this.CurTypeId = CurTypeId;
    }

    public String getCurTypeName() {
        return CurTypeName;
    }

    public void setCurTypeName(String CurTypeName) {
        this.CurTypeName = CurTypeName;
    }

    public Long getExchangeRateId() {
        return ExchangeRateId;
    }

    public void setExchangeRateId(Long ExchangeRateId) {
        this.ExchangeRateId = ExchangeRateId;
    }

    public Double getExchangeRate() {
        return ExchangeRate;
    }

    public void setExchangeRate(Double ExchangeRate) {
        this.ExchangeRate = ExchangeRate;
    }

    public String getPriceTerms() {
        return PriceTerms;
    }

    public void setPriceTerms(String PriceTerms) {
        this.PriceTerms = PriceTerms;
    }

    public Long getSettlementModeId() {
        return SettlementModeId;
    }

    public void setSettlementModeId(Long SettlementModeId) {
        this.SettlementModeId = SettlementModeId;
    }

    public String getSettlementModeName() {
        return SettlementModeName;
    }

    public void setSettlementModeName(String SettlementModeName) {
        this.SettlementModeName = SettlementModeName;
    }

     @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    public Date getExpectedClosingDate() {
        return ExpectedClosingDate;
    }

    public void setExpectedClosingDate(Date ExpectedClosingDate) {
        this.ExpectedClosingDate = ExpectedClosingDate;
    }

    public Double getTotalQuantity() {
        return TotalQuantity;
    }

    public void setTotalQuantity(Double TotalQuantity) {
        this.TotalQuantity = TotalQuantity;
    }

    public Double getTotalCost() {
        return TotalCost;
    }

    public void setTotalCost(Double TotalCost) {
        this.TotalCost = TotalCost;
    }

    public Short getWhatRound() {
        return WhatRound;
    }

    public void setWhatRound(Short WhatRound) {
        this.WhatRound = WhatRound;
    }

    public String getDescription() {
        return Description;
    }

    public void setDescription(String Description) {
        this.Description = Description;
    }

    public String getSignedFlag() {
        return SignedFlag;
    }

    public void setSignedFlag(String SignedFlag) {
        this.SignedFlag = SignedFlag;
    }

    public String getCostForecastFlag() {
        return CostForecastFlag;
    }

    public void setCostForecastFlag(String CostForecastFlag) {
        this.CostForecastFlag = CostForecastFlag;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof ContractReviewHeaderEntity)) {
            return false;
        }

        final ContractReviewHeaderEntity that = (ContractReviewHeaderEntity) o;

        return new EqualsBuilder()
                .append(this.getHeaderId(), that.getHeaderId())
                .isEquals();
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public int hashCode() {
        int result = 17;
        result = 31 * result + getHeaderId().hashCode();

        return result;
    }

    /**
     * {@inheritDoc}
     */
    @Override
    public String toString() {
        return ToStringBuilder.reflectionToString(this);
    }
}
